package lincen.javase.util.excel;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

import jxl.Workbook;
import jxl.read.biff.BiffException;

/**
 * 工作簿, 用户读取配置表.
 * @author 	林岑
 * @time	2012年3月23日 11:17:33
 *
 */
public class LemonWorkBook {

	/**
	 * 工作本
	 */
	private Workbook workBook;
	
	public LemonWorkBook(String fileName) {
		try {
			this.workBook = Workbook.getWorkbook( new FileInputStream( fileName ) );
		} catch (BiffException e) {
			e.printStackTrace();
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	/**
	 * 获取第index个表
	 * @param index
	 * @return
	 */
	public LemonSheet getSheet(int index) {
		return new NormalSheet(this.workBook.getSheet(index));
	}
}
